import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:mall/constant/app_colors.dart';
import 'package:mall/modules/sc/order_sc.dart';
import 'package:mall/ui/widgets/app_base_widgets/app_copy_btn.dart';

class LogisticsPage extends StatefulWidget {
  const LogisticsPage({super.key});

  @override
  State<LogisticsPage> createState() => _LogisticsPageState();
}

class _LogisticsPageState extends State<LogisticsPage> {
  final String? orderID = Get.arguments['orderID'];

  late final sc_orderDetail = Get.put(OrderDetailSc(), tag: orderID);
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('物流详情'),
      ),
      body: Container(
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            _orderSn(),
            Container(
              color: AppColors.C_F8F8F8,
              height: 10,
            )
          ],
        ),
      ),
    );
  }

  Container _orderSn() {
    return Container(
            color: Colors.white,
            padding: EdgeInsets.symmetric(horizontal: 15, vertical: 20),
            child: Column(
              children: [
                Obx(() => Row(
                      children: [
                        Text('订单编号: ${sc_orderDetail.data.value!.orderInfo?.orderSn}'),
                        SizedBox(width: 10),
                        AppCopyBtn(text: sc_orderDetail.data.value!.orderInfo?.orderSn ?? '')
                      ],
                    )),
                SizedBox(height: 10),
                Row(
                  children: [
                    Text('物流公司: ${sc_orderDetail.data.value!.orderInfo?.orderSn}'),
                  ],
                ),
                SizedBox(height: 10),
                Obx(() => Row(
                      children: [
                        Text('物流单号: ${sc_orderDetail.data.value!.orderInfo?.orderSn}'),
                        SizedBox(width: 10),
                        AppCopyBtn(text: sc_orderDetail.data.value!.orderInfo?.orderSn ?? '')
                      ],
                    )),
              ],
            ),
          );
  }
}
